<template>
  <div class="app-container">
    <el-card class="box-card">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"  label-width="98px">
      <el-form-item label="装备承制单位" prop="equipmentContractorUnit">
        <el-select
          v-model="queryParams.equipmentContractorUnit"
          placeholder="请选择装备承制单位"
          clearable
        >
          <el-option
            v-for="dict in dict.type.yh_equipment_contractor_unit"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="项目名称" prop="projectName">
        <el-input
          v-model="queryParams.projectName"
          placeholder="请输入项目名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合同类别" prop="contractType">
        <el-select
          v-model="queryParams.contractType"
          placeholder="请选择合同类别"
          clearable
        >
          <el-option
            v-for="dict in dict.type.yh_contract_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="装备名称" prop="equipName" >
        <el-input
          v-model="queryParams.equipName"
          placeholder="请输入装备名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装备型号" prop="equipVersion" v-show="showSearch">
        <el-input
          v-model="queryParams.equipVersion"
          placeholder="请输入装备型号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="技术状态" prop="technicalConditions" v-show="showSearch">
        <el-input
          v-model="queryParams.technicalConditions"
          placeholder="请输入技术状态"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合同编号" prop="contractNo" v-show="showSearch">
        <el-input
          v-model="queryParams.contractNo"
          placeholder="请输入合同编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合同类型" prop="contractDeclare" v-show="showSearch">
        <el-select
          v-model="queryParams.contractDeclare"
          placeholder="请选择合同类型"
          clearable
        >
          <el-option
            v-for="dict in dict.type.yh_contract_declare"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <!--
      <el-form-item label="监管JS代表室" prop="representativeOffice">
        <el-input
          v-model="queryParams.representativeOffice"
          placeholder="请输入监管JS代表室"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      -->
      <el-form-item label="项目类别" prop="projectType" v-show="showSearch">
        <el-select
          v-model="queryParams.projectType"
          placeholder="请选择项目类别"
          clearable
        >
          <el-option
            v-for="dict in dict.type.yh_item_classification"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <!--<el-form-item label="主管人员" prop="executiveStaff" v-show="showSearch">
        <el-input
          v-model="queryParams.executiveStaff"
          placeholder="请输入主管人员"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item label="流水号" prop="sequenceNumber" v-show="showSearch">
        <el-input
          v-model="queryParams.sequenceNumber"
          placeholder="请输入流水号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--
     <el-form-item label="项目管理机构" prop="managementAgency">
       <el-input
         v-model="queryParams.managementAgency"
         placeholder="请输入项目管理机构"
         clearable
         @keyup.enter.native="handleQuery"
       />
     </el-form-item>
     <el-form-item label="任务状态" prop="taskStatus">
       <el-input
         v-model="queryParams.taskStatus"
         placeholder="请输入任务状态"
         clearable
         @keyup.enter.native="handleQuery"
       />
     </el-form-item>
     <el-form-item label="装备承制单位" prop="equipmentContractorUnit">
       <el-input
         v-model="queryParams.equipmentContractorUnit"
         placeholder="请输入装备承制单位"
         clearable
         @keyup.enter.native="handleQuery"
       />
     </el-form-item>
     <el-form-item label="承制单位" prop="contractorUnit">
       <el-input
         v-model="queryParams.contractorUnit"
         placeholder="请输入承制单位"
         clearable
         @keyup.enter.native="handleQuery"
       />
     </el-form-item>
     <el-form-item label="进度要求" prop="scheduleTarget">
       <el-input
         v-model="queryParams.scheduleTarget"
         placeholder="请输入进度要求"
         clearable
         @keyup.enter.native="handleQuery"
       />
     </el-form-item>
     <el-form-item label="配套合同/协议号" prop="matchingContractNo">
       <el-input
         v-model="queryParams.matchingContractNo"
         placeholder="请输入配套合同/协议号"
         clearable
         @keyup.enter.native="handleQuery"
       />
     </el-form-item>
     <el-form-item label="总体装备承制单位" prop="generalContractorUnit">
       <el-input
         v-model="queryParams.generalContractorUnit"
         placeholder="请输入总体装备承制单位"
         clearable
         @keyup.enter.native="handleQuery"
       />
     </el-form-item>
     <el-form-item label="总体JS代表室" prop="generalRepresentativeOffice">
       <el-input
         v-model="queryParams.generalRepresentativeOffice"
         placeholder="请输入总体JS代表室"
         clearable
         @keyup.enter.native="handleQuery"
       />
     </el-form-item>
     <el-form-item label="任务确认时间" prop="taskConfirmationTime">
       <el-date-picker clearable
                       v-model="queryParams.taskConfirmationTime"
                       type="date"
                       value-format="yyyy-MM-dd"
                       placeholder="请选择任务确认时间">
       </el-date-picker>
     </el-form-item>
     <el-form-item label="完成时间" prop="completionTime">
       <el-date-picker clearable
         v-model="queryParams.completionTime"
         type="date"
         value-format="yyyy-MM-dd"
         placeholder="请选择完成时间">
       </el-date-picker>
     </el-form-item>
     <el-form-item label="支付时间" prop="paymentTime">
       <el-date-picker clearable
         v-model="queryParams.paymentTime"
         type="date"
         value-format="yyyy-MM-dd"
         placeholder="请选择支付时间">
       </el-date-picker>
     </el-form-item>
      -->
      <br/>
      <div style="text-align: right;">
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" >搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" >重置</el-button>
        </div>
      <br/>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['module:cjl:contract:add']"
        >新增</el-button>
      </el-col>
      <!--<el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['module:cjl:contract:edit']"
        >修改</el-button>
      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['module:cjl:contract:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="el-icon-upload2"
          size="mini"
          @click="handleImport"
          v-hasPermi="['module:cjl:contract:import']"
        >导入</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['module:cjl:contract:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="contractList" border @selection-change="handleSelectionChange"  >
      <el-table-column type="selection" width="55" align="center" />
      <!--<el-table-column label="序号" align="center" prop="id" width="60"/>-->
      <el-table-column type="index" label="序号" width="55" :index="indexMethod" align="center" />
      <el-table-column label="项目名称" align="center" prop="projectName" v-if="columns[0].visible"/>
      <el-table-column label="合同类别" align="center" prop="contractType" v-if="columns[1].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_contract_type" :value="scope.row.contractType"/>
        </template>
      </el-table-column>
      <el-table-column label="装备名称" align="center" prop="equipName" v-if="columns[2].visible"/>
      <el-table-column label="装备型号" align="center" prop="equipVersion" v-if="columns[3].visible"/>
      <el-table-column label="数量" align="center" prop="quantity" v-if="columns[4].visible"/>
      <el-table-column label="技术状态" align="center" prop="technicalConditions" v-if="columns[5].visible"/>
      <el-table-column label="合同编号" align="center" prop="contractNo" v-if="columns[6].visible"/>
      <el-table-column label="合同类型" align="center" prop="contractDeclare" v-if="columns[7].visible">
      <template slot-scope="scope">
        <dict-tag :options="dict.type.yh_contract_declare" :value="scope.row.contractDeclare"/>
      </template>
      </el-table-column>
      <el-table-column label="监管JS代表室" align="center"  prop="representativeOffice" v-if="columns[8].visible">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yh_representative_office" :value="scope.row.representativeOffice"/>
        </template>
      </el-table-column>
      <el-table-column label="监管事项" align="center" prop="regulation" v-if="columns[9].visible"/>
      <el-table-column label="项目类别" align="center" prop="projectType" v-if="columns[10].visible">
      <template slot-scope="scope">
        <dict-tag :options="dict.type.yh_item_classification" :value="scope.row.projectType"/>
      </template>
      </el-table-column>
      <el-table-column label="采购部门" align="center" prop="purchasingDepartment" v-if="columns[11].visible"/>
      <el-table-column label="主管人员" align="center" prop="executiveStaff" v-if="columns[12].visible"/>
      <el-table-column label="项目管理机构" align="center" prop="managementAgency" v-if="columns[13].visible"/>
      <el-table-column label="任务状态" align="center" prop="taskStatus" v-if="columns[14].visible">
      <template slot-scope="scope">
        <dict-tag :options="dict.type.sys_job_status" :value="scope.row.taskStatus"/>
      </template>
      </el-table-column>
      <el-table-column label="装备承制单位" align="center" prop="equipmentContractor" v-if="columns[15].visible">
      <template slot-scope="scope">
        <dict-tag :options="dict.type.yh_equipment_contractor_unit" :value="scope.row.equipmentContractor"/>
      </template>
      </el-table-column>
      <el-table-column label="承制单位" align="center" prop="contractorUnit" v-if="columns[16].visible">
      <template slot-scope="scope">
        <dict-tag :options="dict.type.yh_contractor_unit" :value="scope.row.contractorUnit"/>
      </template>
      </el-table-column>
      <el-table-column label="进度要求" align="center" prop="scheduleTarget" v-if="columns[17].visible"/>
      <el-table-column label="配套合同/协议号" align="center" prop="matchingContractNo" v-if="columns[18].visible"/>
      <el-table-column label="总体装备承制单位" align="center" prop="generalContractorUnit" v-if="columns[19].visible"/>
      <el-table-column label="总体JS代表室" align="center" prop="generalRepresentativeOffice" v-if="columns[20].visible"/>
      <el-table-column label="任务确认时间" align="center" prop="taskConfirmationTime" v-if="columns[21].visible" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.taskConfirmationTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="完成时间" align="center" prop="completionTime" v-if="columns[22].visible" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.completionTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="支付时间" align="center" prop="paymentTime" v-if="columns[23].visible" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.paymentTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" v-if="columns[24].visible" />
      <el-table-column label="流水号" align="center" prop="sequenceNumber" v-if="columns[25].visible"/>
      <el-table-column label="合同关联号" align="center" prop="contractAssociationNo" v-if="columns[26].visible" />
      <el-table-column label="合同关联状态" align="center" prop="contractAssociationStatus" v-if="columns[27].visible">
        <template slot-scope="scope">
          <span v-if="scope.row.contractAssociationStatus==1"><font color="#dc143c">未关联</font></span>
          <span v-if="scope.row.contractAssociationStatus==2">已关联</span>
        </template>
      </el-table-column>
      <el-table-column label="交付时间" align="center" prop="deliveryTime" width="180" v-if="columns[28].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="发文字号" align="center" prop="messageNumber" v-if="columns[29].visible"/>
      <el-table-column label="计划名称" align="center" prop="planName" v-if="columns[30].visible"/>
      <el-table-column label="M级" align="center" prop="security" v-if="columns[31].visible">
      <template slot-scope="scope">
        <dict-tag :options="dict.type.yh_security_grade" :value="scope.row.security"/>
      </template>
      </el-table-column>
      <el-table-column label="发文日期" align="center" prop="messageDate" width="180" v-if="columns[32].visible">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.messageDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="正式任务/任务预告" align="center" prop="formalTask" v-if="columns[33].visible"/>
      <el-table-column label="装备采购部门" align="center" prop="procurementDepartment" v-if="columns[34].visible"/>
      <el-table-column label="项目编号" align="center" prop="projectNo" v-if="columns[35].visible"/>
      <el-table-column label="采购类别" align="center" prop="purchaseCategory" v-if="columns[36].visible"/>
      <el-table-column label="项目预估经费" align="center" prop="projectFunds" v-if="columns[37].visible"/>
      <el-table-column label="是否异地监管" align="center" prop="remoteSupervision" v-if="columns[38].visible"/>
      <el-table-column label="所属军代局" align="center" prop="representativeOfficeBelongs" v-if="columns[39].visible"/>
      <el-table-column label="所属军代局主管机关" align="center" prop="competentAuthorityAgency" v-if="columns[40].visible"/>
      <el-table-column label="时间要求" align="center" prop="timeRequirements" v-if="columns[41].visible"/>
      <el-table-column label="项目实际总金额" align="center" prop="actualTotalAmount" v-if="columns[42].visible"/>
      <el-table-column label="操作" align="center"  width="160" class-name="small-padding fixed-width" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['module:cjl:contract:edit']"
          >修改</el-button>
         <el-button
            size="mini"
            type="text"
            @click="handleDelete(scope.row)"
            v-hasPermi="['module:cjl:contract:remove']"
          >删除</el-button>
          <el-button
            size="mini"
            type="text"
            @click="handleView(scope.row,scope.index)"
            v-hasPermi="['module:cjl:contract:view']"
          >详细</el-button>
        <el-button
          size="mini"
          type="text"
          @click="handleRelea(scope.row)"
          v-hasPermi="['module:cjl:contract:relea']"
        >关联</el-button>
          <el-button
            size="mini"
            type="text"
            @click="handleContractTask(scope.row)"
            v-hasPermi="['module:cjl:contract:contracttask']"
          >任务概览</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    </el-card>
    <!-- 添加或修改合同台账对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-width="150px">
        <el-container>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 18px;">合同类别</p>
            </el-divider>
          </el-header>
          <el-main>
            <el-col :span="8">
              <el-form-item label="所属合同" prop="contractType">
            <span slot="label">
              所属合同
              </span>
                  <el-radio-group v-model="form.contractType">
                    <el-radio
                      style="float:left"
                      v-for="dict in dict.type.yh_contract_type"
                      :key="dict.value"
                      :label="dict.value"
                    >{{dict.label}}</el-radio>
                  </el-radio-group>
              </el-form-item>
            </el-col>
          </el-main>
        </el-container>
        <el-container>
          <div id="1" style="width: 100%" v-if="form.contractType == '1'">
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">J方直签合同信息</p>
            </el-divider>
            </el-header>
          <el-main>
        <el-row>
          <el-col :span="8">
        <el-form-item label="项目名称" prop="projectName">
          <el-input v-model="form.projectName" placeholder="请输入项目名称" style="width: 100%" clearable/>
        </el-form-item>
          </el-col>
        <!--  <el-col :span="8">
        <el-form-item label="合同类型" prop="contractDeclare">
          <el-select v-model="form.contractDeclare" placeholder="请选择合同类型" style="width: 100%">
            <el-option
              v-for="dict in dict.type.yh_contract_declare"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
          </el-col>-->
          <el-col :span="8">
            <el-form-item label="装备名称" prop="equipName">
              <el-input v-model="form.equipName" placeholder="请输入装备名称" style="width: 100%"  clearable/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="装备型号" prop="equipVersion">
              <el-input v-model="form.equipVersion" placeholder="请输入装备型号" style="width: 100%"  clearable/>
            </el-form-item>
          </el-col>
        </el-row>
            <el-row>
          <el-col :span="8">
        <el-form-item label="数量" prop="quantity">
          <el-input-number v-model="form.quantity" controls-position="right" :min="0" style="width: 100%"/>
          <!--<el-input v-model="form.quantity" placeholder="请输入数量" style="width: 95%"/>-->
          </el-form-item>
          </el-col>
              <el-col :span="8">
                <el-form-item label="交付时间" prop="deliveryTime">
                  <el-date-picker clearable
                                  style="width: 100%"
                                  v-model="form.deliveryTime"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择交付时间">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="技术状态" prop="technicalConditions">
                  <el-input v-model="form.technicalConditions" placeholder="请输入技术状态" style="width: 100%"  clearable/>
                </el-form-item>
              </el-col>
        </el-row>
            <el-row>
          <!--<el-col :span="8">
            <el-form-item label="监管JS代表室" prop="deptId">
              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择监管JS代表室" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
        <el-form-item label="合同编号" prop="contractNo">
          <el-input v-model="form.contractNo" placeholder="请输入合同编号" style="width: 100%"/>
        </el-form-item>
          </el-col>-->
              <el-col :span="8">
              <el-form-item label="采购卡片/合同/协议" prop="purchaseCard">
                <el-input v-model="form.purchaseCard" placeholder="请输入采购卡片/合同/协议"  clearable/>
              </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="合同编号" prop="contractNo">
                  <el-input v-model="form.contractNo" placeholder="请输入合同编号" style="width: 100%"  clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="合同类型" prop="contractDeclare">
                  <el-select v-model="form.contractDeclare" placeholder="请选择合同类型" style="width: 100%"  clearable>
                    <el-option
                      v-for="dict in dict.type.yh_contract_declare"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
        </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="采购部门" prop="purchasingDepartment">
                  <el-input v-model="form.purchasingDepartment" placeholder="请输入采购部门" style="width: 100%"  clearable/>
                </el-form-item>
              </el-col>
          <el-col :span="8">
        <el-form-item label="监管事项" prop="regulation">
         <el-input v-model="form.regulation" placeholder="请输入监管事项" style="width: 100%"  clearable/>
        </el-form-item>
          </el-col>
              <el-col :span="8">
                <el-form-item label="项目管理机构" prop="managementAgency">
                  <el-input v-model="form.managementAgency" placeholder="请输入项目管理机构" style="width: 100%"  clearable/>
                </el-form-item>
              </el-col>
          <!--<el-col :span="8">
            <el-form-item label="项目类别" prop="projectType">
              <el-select v-model="form.projectType" placeholder="请选择项目类别" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.yh_item_classification"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
              &lt;!&ndash;<el-input v-model="form.projectType" placeholder="请输入项目类别" style="width: 100%"/>&ndash;&gt;
            </el-form-item>
          </el-col>-->
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="装备承制单位" prop="equipmentContractor">
                  <el-select v-model="form.equipmentContractor" placeholder="请选择装备承制单位" style="width: 100%"  clearable>
                    <el-option
                      v-for="dict in dict.type.yh_equipment_contractor_unit"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                  <!-- <el-input v-model="form.equipmentContractorUnit" placeholder="请输入装备承制单位" style="width: 95%"/>-->
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="监管JS代表室" prop="representativeOffice">
                  <el-select v-model="form.representativeOffice" placeholder="请选择监管JS代表室" style="width: 100%"  clearable>
                    <el-option
                      v-for="dict in dict.type.yh_representative_office"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                  <!--<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择监管JS代表室" />-->
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="项目类别" prop="projectType">
                  <el-select v-model="form.projectType" placeholder="请选择项目类别" style="width: 100%"  clearable>
                    <el-option
                      v-for="dict in dict.type.yh_item_classification"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <!--<el-col :span="8">
                <el-form-item label="承制单位"  prop="contractorUnit">
                  <el-select v-model="form.contractorUnit" placeholder="请选择承制单位" style="width: 100%">
                    <el-option
                      v-for="dict in dict.type.yh_contractor_unit"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                  &lt;!&ndash; <el-input v-model="form.contractorUnit" placeholder="请输入承制单位" style="width: 95%"/>&ndash;&gt;
                </el-form-item>
              </el-col>-->
         <!-- <el-col :span="8">
            <el-form-item>
              <span slot="label">
                <el-tooltip content="选择停用该任务将会停止，也不能被访问" placement="top">
                <i class="el-icon-question"></i>
                </el-tooltip>
                 任务状态
              </span>
              <el-radio-group v-model="form.taskStatus">
                <el-radio
                  v-for="dict in dict.type.sys_job_status"
                  :key="dict.value"
                  :label="dict.value"
                >{{dict.label}}</el-radio>
              </el-radio-group>
             &lt;!&ndash; <el-input v-model="form.taskStatus" placeholder="请输入任务状态" style="width: 95%"/>&ndash;&gt;
            </el-form-item>-->
              <!--<el-col :span="8">
                <el-form-item label="合同类别" prop="contractType">
            <span slot="label">
              合同类别
              </span>
                  <el-radio-group v-model="form.contractType">
                    <el-radio
                      v-for="dict in dict.type.yh_contract_type"
                      :key="dict.value"
                      :label="dict.value"
                    >{{dict.label}}</el-radio>
                  </el-radio-group>
                  &lt;!&ndash;<el-input v-model="form.contractDeclare" placeholder="请输入合同类型" style="width: 95%"/>&ndash;&gt;
                </el-form-item>
              </el-col>-->
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="任务确认时间" prop="taskConfirmationTime">
                  <el-date-picker clearable
                                  v-model="form.taskConfirmationTime"
                                  type="date"
                                  style="width: 100%"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择任务确认时间">

                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="主管人员" prop="executiveStaff">
                  <el-autocomplete
                    clearable
                    style="width: 100%"
                    placeholder="请输入主管人员"
                    v-model="form.executiveStaff"
                    :fetch-suggestions="querySearchAsync"
                    @select="handleSelect"
                  >
                  </el-autocomplete>
                <!--  <el-input v-model="form.executiveStaff" placeholder="请输入主管人员"  style="width: 100%"  maxlength="100" clearable/>-->
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="流水号" prop="sequenceNumber">
                  <el-input v-model="form.sequenceNumber" placeholder="请输入流水号" style="width: 100%"  clearable/>
                </el-form-item>
              </el-col>
         <!-- <el-col :span="8">
        <el-form-item label="完成时间" prop="completionTime">
          <el-date-picker
            clearable
            style="width: 100%"
            v-model="form.completionTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择完成时间">
          </el-date-picker>
        </el-form-item>
          </el-col>-->
        </el-row>
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" maxlength="500" />
            </el-form-item>
            </el-main>
          </div>
        </el-container>
        <el-container>
          <div id="app"  style="width: 100%" v-if="form.contractType == '2'">
            <el-header>
              <el-divider content-position="left">
                <p style="color: #00afff; font-size: 20px;">装备承制单位合同信息</p>
              </el-divider>
            </el-header>
            <el-main>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="项目名称" prop="projectName">
                    <el-input v-model="form.projectName" placeholder="请输入项目名称" style="width: 100%"  clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="配套设备名称" prop="supportingEquipment">
                    <el-input v-model="form.supportingEquipment" placeholder="请输入配套设备名称"  clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="装备型号" prop="equipVersion">
                    <el-input v-model="form.equipVersion" placeholder="请输入装备型号" style="width: 100%"  clearable/>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="数量" prop="quantity">
                    <el-input-number v-model="form.quantity" controls-position="right" :min="0" style="width: 100%"  clearable/>
                    <!--<el-input v-model="form.quantity" placeholder="请输入数量" style="width: 95%"/>-->
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="交付时间" prop="deliveryTime">
                    <el-date-picker clearable
                                    style="width: 100%"
                                    v-model="form.deliveryTime"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    placeholder="请选择交付时间">
                    </el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="技术状态" prop="technicalConditions">
                    <el-input v-model="form.technicalConditions" placeholder="请输入技术状态" style="width: 100%"  clearable/>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="进度要求" prop="scheduleTarget">
                    <el-input v-model="form.scheduleTarget" placeholder="请输入进度要求" style="width: 100%" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="配套合同/协议号"  prop="matchingContractNo">
                    <el-input v-model="form.matchingContractNo" placeholder="请输入配套合同/协议号" style="width: 100%"  clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="装备承制单位" prop="equipmentContractor">
                    <el-select v-model="form.equipmentContractor" placeholder="请选择装备承制单位" style="width: 100%"  clearable>
                      <el-option
                        v-for="dict in dict.type.yh_equipment_contractor_unit"
                        :key="dict.value"
                        :label="dict.label"
                        :value="dict.value"
                      ></el-option>
                    </el-select>
                    <!-- <el-input v-model="form.equipmentContractorUnit" placeholder="请输入装备承制单位" style="width: 95%"/>-->
                  </el-form-item>
                </el-col>
               <!-- <el-col :span="8">
                  <el-form-item label="采购部门" prop="purchasingDepartment">
                    <el-input v-model="form.purchasingDepartment" placeholder="请输入采购部门" style="width: 100%"/>
                  </el-form-item>
                </el-col>-->
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="采购卡片/合同/协议" prop="purchaseCard">
                    <el-input v-model="form.purchaseCard" placeholder="请输入采购卡片/合同/协议"  clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="合同类型" prop="contractDeclare">
                    <el-select v-model="form.contractDeclare" placeholder="请选择合同类型" style="width: 100%"  clearable >
                      <el-option
                        v-for="dict in dict.type.yh_contract_declare"
                        :key="dict.value"
                        :label="dict.label"
                        :value="dict.value"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="总体JS代表室" prop="generalRepresentativeOffice">
                    <el-input v-model="form.generalRepresentativeOffice" placeholder="请输入总体JS代表室" style="width: 100%" clearable/>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="总体装备承制单位" prop="generalContractorUnit">
                    <el-input v-model="form.generalContractorUnit" placeholder="请输入总体装备承制单位" style="width: 100%"clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="监管JS代表室" prop="representativeOffice">
                    <el-select v-model="form.representativeOffice" placeholder="请选择监管JS代表室" style="width: 100%"  clearable>
                      <el-option
                        v-for="dict in dict.type.yh_representative_office"
                        :key="dict.value"
                        :label="dict.label"
                        :value="dict.value"
                      ></el-option>
                    </el-select>
                    <!--<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择监管JS代表室" />-->
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="监管事项" prop="regulation">
                    <el-input v-model="form.regulation" placeholder="请输入监管事项" style="width: 100%"clearable/>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="项目类别" prop="projectType">
                    <el-select v-model="form.projectType" placeholder="请选择项目类别" style="width: 100%"  clearable>
                      <el-option
                        v-for="dict in dict.type.yh_item_classification"
                        :key="dict.value"
                        :label="dict.label"
                        :value="dict.value"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="任务确认时间" prop="taskConfirmationTime">
                    <el-date-picker clearable
                                    v-model="form.taskConfirmationTime"
                                    type="date"
                                    style="width: 100%"
                                    value-format="yyyy-MM-dd"
                                    placeholder="请选择任务确认时间">

                    </el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="主管人员" prop="executiveStaff">
                    <el-autocomplete
                      clearable
                      style="width: 100%"
                      placeholder="请输入主管人员"
                      v-model="form.executiveStaff"
                      :fetch-suggestions="querySearchAsync"
                      @select="handleSelect"
                    >
                    </el-autocomplete>
                   <!-- <el-input v-model="form.executiveStaff" placeholder="请输入主管人员"  style="width: 100%" clearable/>-->
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="采购部门" prop="purchasingDepartment">
                    <el-input v-model="form.purchasingDepartment" placeholder="请输入采购部门" style="width: 100%" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="项目管理机构" prop="managementAgency">
                    <el-input v-model="form.managementAgency" placeholder="请输入项目管理机构" style="width: 100%" clearable/>
                  </el-form-item>
                </el-col>
              <el-col :span="8">
                <el-form-item label="流水号" prop="sequenceNumber">
                  <el-input v-model="form.sequenceNumber" placeholder="请输入流水号" style="width: 100%" clearable/>
                </el-form-item>
              </el-col>
              </el-row>
              <el-form-item label="备注" prop="remark">
                <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" maxlength="500"/>
              </el-form-item>
            </el-main>
          </div>
        </el-container>

        <el-container>
          <div id="2" style="width: 100%" v-if="form.contractType == '3'">
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">基础信息</p>
            </el-divider>
          </el-header>
            <el-main>
            <el-row>
              <el-col :span="8">
                <el-form-item label="发文字号" prop="messageNumber">
                  <el-input v-model="form.messageNumber" placeholder="请输入发文字号" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="计划名称" prop="planName">
                  <el-input v-model="form.planName" placeholder="请输入计划名称" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="M级" prop="security">
                  <el-select v-model="form.security" placeholder="请选择M级" style="width: 100%" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_security_grade"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="发文日期" prop="messageDate">
                  <el-date-picker clearable
                                  style="width: 100%"
                                  v-model="form.messageDate"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择发文日期">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="正式任务/任务预告" prop="formalTask">
                  <el-input v-model="form.formalTask" placeholder="请输入正式任务/任务预告" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="装备采购部门" prop="procurementDepartment">
                  <el-input v-model="form.procurementDepartment" placeholder="请输入装备采购部门" clearable/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="项目编号" prop="projectNo">
                  <el-input v-model="form.projectNo" placeholder="请输入项目编号" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="采购类别" prop="purchaseCategory">
                  <el-input v-model="form.purchaseCategory" placeholder="请输入采购类别" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="项目预估经费" prop="projectFunds">
                  <el-input v-model="form.projectFunds" placeholder="请输入项目预估经费" clearable @input="inputFunds">
                    <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px;">万元</i>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="承制单位"  prop="contractorUnit">
                  <el-select v-model="form.contractorUnit" placeholder="请选择承制单位" style="width: 100%" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_contractor_unit"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="是否异地监管" prop="remoteSupervision">
                  <el-input v-model="form.remoteSupervision" placeholder="请输入是否异地监管" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="所属军代局" prop="representativeOfficeBelongs">
                  <el-input v-model="form.representativeOfficeBelongs" placeholder="请输入所属军代局" clearable/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="军代局主管机关" prop="competentAuthorityAgency">
                  <el-input v-model="form.competentAuthorityAgency" placeholder="请输入所属军代局主管机关" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="时间要求" prop="timeRequirements">
                  <el-input v-model="form.timeRequirements" placeholder="请输入时间要求" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="项目实际总金额" prop="actualTotalAmount">
                  <el-input v-model="form.actualTotalAmount" placeholder="请输入项目实际总金额" clearable @input="inputTotalAmount">
                    <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px;">万元</i>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="监管JS代表室" prop="representativeOffice">
                    <el-select v-model="form.representativeOffice" placeholder="请选择监管JS代表室" style="width: 100%"  clearable>
                      <el-option
                        v-for="dict in dict.type.yh_representative_office"
                        :key="dict.value"
                        :label="dict.label"
                        :value="dict.value"
                      ></el-option>
                    </el-select>
                    <!--<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择监管JS代表室" />-->
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="主管人员" prop="executiveStaff">
                    <el-autocomplete
                      clearable
                      style="width: 100%"
                      placeholder="请输入主管人员"
                      v-model="form.executiveStaff"
                      :fetch-suggestions="querySearchAsync"
                      @select="handleSelect"
                    >
                    </el-autocomplete>
                    <!-- <el-input v-model="form.executiveStaff" placeholder="请输入主管人员"  style="width: 100%" clearable/>-->
                  </el-form-item>
                </el-col>
              </el-row>
          </el-main>
          </div>
        </el-container>
        <el-container>
          <div id="6" style="width: 100%" v-if="form.contractType == '4'">
            <el-header>
              <el-divider content-position="left">
                <p style="color: #00afff; font-size: 20px;">基础信息</p>
              </el-divider>
            </el-header>
            <el-main>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="发文字号" prop="messageNumber">
                    <el-input v-model="form.messageNumber" placeholder="请输入发文字号" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="计划名称" prop="planName">
                    <el-input v-model="form.planName" placeholder="请输入计划名称" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="M级" prop="security">
                    <el-select v-model="form.security" placeholder="请选择M级" style="width: 100%" clearable>
                      <el-option
                        v-for="dict in dict.type.yh_security_grade"
                        :key="dict.value"
                        :label="dict.label"
                        :value="dict.value"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="发文日期" prop="messageDate">
                    <el-date-picker clearable
                                    style="width: 100%"
                                    v-model="form.messageDate"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    placeholder="请选择发文日期">
                    </el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="正式任务/任务预告" prop="formalTask">
                    <el-input v-model="form.formalTask" placeholder="请输入正式任务/任务预告" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="装备采购部门" prop="procurementDepartment">
                    <el-input v-model="form.procurementDepartment" placeholder="请输入装备采购部门" clearable/>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="项目编号" prop="projectNo">
                    <el-input v-model="form.projectNo" placeholder="请输入项目编号" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="采购类别" prop="purchaseCategory">
                    <el-input v-model="form.purchaseCategory" placeholder="请输入采购类别" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="项目预估经费" prop="projectFunds">
                    <el-input v-model="form.projectFunds" placeholder="请输入项目预估经费" clearable @input="inputFunds">
                      <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px;">万元</i>
                    </el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="承制单位"  prop="contractorUnit">
                    <el-select v-model="form.contractorUnit" placeholder="请选择承制单位" style="width: 100%" clearable>
                      <el-option
                        v-for="dict in dict.type.yh_contractor_unit"
                        :key="dict.value"
                        :label="dict.label"
                        :value="dict.value"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="是否异地监管" prop="remoteSupervision">
                    <el-input v-model="form.remoteSupervision" placeholder="请输入是否异地监管" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="所属军代局" prop="representativeOfficeBelongs">
                    <el-input v-model="form.representativeOfficeBelongs" placeholder="请输入所属军代局" clearable/>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="军代局主管机关" prop="competentAuthorityAgency">
                    <el-input v-model="form.competentAuthorityAgency" placeholder="请输入所属军代局主管机关" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="时间要求" prop="timeRequirements">
                    <el-input v-model="form.timeRequirements" placeholder="请输入时间要求" clearable/>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="项目实际总金额" prop="actualTotalAmount">
                    <el-input v-model="form.actualTotalAmount" placeholder="请输入项目实际总金额" clearable @input="inputTotalAmount">
                      <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px;">万元</i>
                    </el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="监管JS代表室" prop="representativeOffice">
                    <el-select v-model="form.representativeOffice" placeholder="请选择监管JS代表室" style="width: 100%"  clearable>
                      <el-option
                        v-for="dict in dict.type.yh_representative_office"
                        :key="dict.value"
                        :label="dict.label"
                        :value="dict.value"
                      ></el-option>
                    </el-select>
                    <!--<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择监管JS代表室" />-->
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="主管人员" prop="executiveStaff">
                    <el-autocomplete
                      clearable
                      style="width: 100%"
                      placeholder="请输入主管人员"
                      v-model="form.executiveStaff"
                      :fetch-suggestions="querySearchAsync"
                      @select="handleSelect"
                    >
                    </el-autocomplete>
                    <!-- <el-input v-model="form.executiveStaff" placeholder="请输入主管人员"  style="width: 100%" clearable/>-->
                  </el-form-item>
                </el-col>
              </el-row>
            </el-main>
          </div>
        </el-container>
        <el-container>
          <div id="0" style="width: 100%" v-if="form.contractType == '1'||form.contractType == '2'">
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">基础信息</p>
            </el-divider>
          </el-header>
          <el-main>
            <el-row>
              <el-col :span="8">
                <el-form-item label="发文字号" prop="messageNumber">
                  <el-input v-model="form.messageNumber" placeholder="请输入发文字号" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="计划名称" prop="planName">
                  <el-input v-model="form.planName" placeholder="请输入计划名称" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="M级" prop="security">
                  <el-select v-model="form.security" placeholder="请选择M级" style="width: 100%" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_security_grade"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="发文日期" prop="messageDate">
                  <el-date-picker clearable
                                  style="width: 100%"
                                  v-model="form.messageDate"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  placeholder="请选择发文日期">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="正式任务/任务预告" prop="formalTask">
                  <el-input v-model="form.formalTask" placeholder="请输入正式任务/任务预告" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="装备采购部门" prop="procurementDepartment">
                  <el-input v-model="form.procurementDepartment" placeholder="请输入装备采购部门" clearable/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>

            <el-col :span="8">
              <el-form-item label="项目编号" prop="projectNo">
                <el-input v-model="form.projectNo" placeholder="请输入项目编号" clearable/>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="采购类别" prop="purchaseCategory">
                <el-input v-model="form.purchaseCategory" placeholder="请输入采购类别" clearable/>
              </el-form-item>
            </el-col>
              <el-col :span="8">
                <el-form-item label="项目预估经费" prop="projectFunds">
                  <el-input v-model="form.projectFunds" placeholder="请输入项目预估经费" clearable @input="inputFunds">
                    <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px;">万元</i>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="承制单位"  prop="contractorUnit">
                  <el-select v-model="form.contractorUnit" placeholder="请选择承制单位" style="width: 100%" clearable>
                    <el-option
                      v-for="dict in dict.type.yh_contractor_unit"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="8">
              <el-form-item label="是否异地监管" prop="remoteSupervision">
                <el-input v-model="form.remoteSupervision" placeholder="请输入是否异地监管" clearable/>
              </el-form-item>
              </el-col>
              <el-col :span="8">
              <el-form-item label="所属军代局" prop="representativeOfficeBelongs">
                <el-input v-model="form.representativeOfficeBelongs" placeholder="请输入所属军代局" clearable/>
              </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="军代局主管机关" prop="competentAuthorityAgency">
                  <el-input v-model="form.competentAuthorityAgency" placeholder="请输入所属军代局主管机关" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
              <el-form-item label="时间要求" prop="timeRequirements">
                <el-input v-model="form.timeRequirements" placeholder="请输入时间要求" clearable/>
              </el-form-item>
              </el-col>
              <el-col :span="8">
              <el-form-item label="项目实际总金额" prop="actualTotalAmount">
                <el-input v-model="form.actualTotalAmount" placeholder="请输入项目实际总金额" clearable @input="inputTotalAmount">
                <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px;">万元</i>
                </el-input>
              </el-form-item>
              </el-col>
            </el-row>
          </el-main>
          </div>
        </el-container>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 用户导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <div class="el-upload__tip" slot="tip">
            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的监管任务数据
          </div>
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link type="danger" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 关联添加或修改合同对话框 -->
    <el-dialog :title="relea.title" :visible.sync="relea.open" width="1200px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules2" label-width="130px">
        <el-container>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">任务台账基本信息</p>
            </el-divider>
          </el-header>
          <el-main>
            <el-row>
             <!-- <el-col :span="8">
        <el-form-item label="合同关联号" prop="batchNum">
          <el-input v-model="form.batchNum"  readonly="true"/>
        </el-form-item>
              </el-col>-->
              <el-col :span="8">
        <el-form-item label="合同编号" prop="contractNo">
          <el-input v-model="form.contractNo"  readonly="true" />
        </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="责任人" prop="personLiable">
                  <el-input v-model="form.personLiable"  readonly="true"/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
        <el-form-item label="数量" prop="quantity">
          <el-input-number v-model="form.quantity" controls-position="right" :min="0" style="width: 100%" disabled="true"/>
        <!--  <el-input v-model="form.quantity" placeholder="请输入数量" readonly="true"/>-->
        </el-form-item>
              </el-col>
            </el-row>
            <el-row>
            <el-col :span="8">
              <el-form-item label="任务ID" prop="taskId">
                <el-input v-model="form.taskId" readonly="true"/>
              </el-form-item>
            </el-col>
            </el-row>
          </el-main>
        </el-container>
        <el-container>
          <el-header>
            <el-divider content-position="left">
              <p style="color: #00afff; font-size: 20px;">产品零件信息</p>
            </el-divider>
          </el-header>
          <el-main>
            <el-row>
              <el-col :span="8">
                <el-form-item label="合同匹配产品类型" prop="productType">
                  <el-select v-model="form.productType" multiple placeholder="请选择合同匹配产品类型" style="width: 100%">
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value">
                    </el-option>
                  </el-select>
                  <!--<el-input v-model="form.productType" placeholder="请输入合同匹配产品类型" />-->
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="合同匹配零件类型" prop="partType">
                  <el-select v-model="form.partType" multiple placeholder="请选择合同匹配零件类型" style="width: 100%">
                    <el-option
                      v-for="item in partoptions"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value">
                    </el-option>
                  </el-select>
                 <!-- <el-input v-model="form.partType" placeholder="请输入合同匹配零件类型" />-->
                </el-form-item>
              </el-col>
              </el-row>
          </el-main>
        </el-container>
            <el-container>
              <el-header>
                <el-divider content-position="left">
                  <p style="color: #00afff; font-size: 20px;">合同台账基本信息</p>
                </el-divider>
              </el-header>
              <el-main>
            <el-row>
              <el-col :span="8">
                <el-form-item label="协议号" prop="agreementNo">
                  <el-input v-model="form.agreementNo" placeholder="请输入协议号" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="合同名称" prop="characteristicNum">
                  <el-input v-model="form.characteristicNum" placeholder="请输入合同名称" clearable/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
        <el-form-item label="计量单位" prop="measurementUnit">
          <el-select v-model="form.measurementUnit" placeholder="请选择计量单位" style="width: 100%" clearable>
            <el-option
              v-for="dict in dict.type.yh_measurement_unit"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
          <!--<el-input v-model="form.measurementUnit" placeholder="请输入计量单位" />-->
        </el-form-item>
              </el-col>
            </el-row>
                <el-row>
              <el-col :span="8">
        <el-form-item label="单价" prop="price">
          <el-input v-model="form.price" placeholder="请输入单价" clearable/>
        </el-form-item>
              </el-col>
              <el-col :span="8">
        <el-form-item label="金额" prop="money">
            <el-input v-model="form.money" placeholder="请输入金额" clearable @input="inputNum">
              <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px;">万元</i>
            </el-input>
        </el-form-item>
              </el-col>
                  <el-col :span="8">
                    <el-form-item label="交付进度" prop="deliverySchedule">
                      <el-input v-model="form.deliverySchedule" placeholder="请输入交付进度" clearable/>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
              <el-col :span="8">
        <el-form-item label="全部交付时间" prop="allDeliveryTime">
          <el-date-picker clearable
                          v-model="form.allDeliveryTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          style="width: 100%"
                          placeholder="请选择全部交付时间">
          </el-date-picker>
        </el-form-item>
              </el-col>
              <el-col :span="8">
        <el-form-item label="合同总金额" prop="totalContractAmount">
          <el-input v-model="form.totalContractAmount" placeholder="请输入合同总金额" clearable @input="inputAmount">
            <i slot="suffix" style="font-style:normal;margin-right: 10px; line-height: 30px;">万元</i>
          </el-input>
        </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="签订时间" prop="signingDate">
                  <el-date-picker clearable
                                  v-model="form.signingDate"
                                  type="date"
                                  value-format="yyyy-MM-dd"
                                  style="width: 100%"
                                  placeholder="请选择签订时间">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>
        <el-form-item label="备注" prop="note1">
          <el-input v-model="form.note1" type="textarea" placeholder="请输入备注" maxlength="1000"/>
        </el-form-item>
          </el-main>
        </el-container>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="releasubmitForm">确 定</el-button>
        <el-button @click="releaCancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listContract, getContract, delContract, addContract, updateContract,userlist } from "@/api/module/cjl/contract";
import { listProduct} from "@/api/module/gs/product/product";
import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import watermark from "watermark-dom";
import { listSecond, getSecond, delSecond, addSecond, updateSecond } from "@/api/module/cjl/second";
export default {
  name: "Contract",
  dicts: ['sys_job_status','yh_contract_type','yh_contract_declare','yh_item_classification','yh_representative_office','yh_equipment_contractor_unit','yh_contractor_unit','yh_security_grade','yh_measurement_unit'],
  components: { Treeselect },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 用户表格数据
      userList:[],
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: false,
      // 总条数
      total: 0,
      // 部门树选项
      deptOptions: undefined,
      // 合同台账表格数据
      contractList: [],
      // 岗位选项
      postOptions: [],
      //产品类型选项
      options: [],
      //零件类型选项
      partoptions: [],
      // 部门名称
      deptName: undefined,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        sequenceNumber: null,
        contractAssociationNo: null,
        purchaseCard: null,
        projectName: null,
        contractType: null,
        equipName: null,
        equipVersion: null,
        quantity: null,
        technicalConditions: null,
        contractNo: null,
        contractDeclare: null,
        representativeOffice: null,
        regulation: null,
        projectType: null,
        purchasingDepartment: null,
        managementAgency: null,
        taskConfirmationTime: null,
        executiveStaff: null,
        taskStatus: null,
        completionTime: null,
        deliveryTime: null,
        messageNumber: null,
        planName: null,
        security: null,
        messageDate: null,
        formalTask: null,
        procurementDepartment: null,
        projectNo: null,
        purchaseCategory: null,
        projectFunds: null,
        manufacturer: null,
        remoteSupervision: null,
        representativeOfficeBelongs: null,
        competentAuthorityAgency: null,
        timeRequirements: null,
        actualTotalAmount: null,
        note: null,
        userId: null,
        deptId: null,
        equipmentContractor: null,
        paymentTime: null,
        contractAssociationStatus: null,
        scheduleTarget: null,
        contractorUnit: null,
        supportingEquipment: null,
        matchingContractNo: null,
        generalRepresentativeOffice: null,
        generalContractorUnit: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {money:'',totalContractAmount:'',projectFunds:'',actualTotalAmount:''},
      // 用户查询参数
      view: {
        // 是否显示弹出层（用户查询）
        open: false,
        // 弹出层标题（用户查询）
        title: "",
      },
      // 关联查询参数
      relea: {
        // 是否显示弹出层（用户查询）
        open: false,
        // 弹出层标题（用户查询）
        title: "",
      },
      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: {Authorization: "Bearer " + getToken()},
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/module/cjl/contract/importData"
      },
      // 列信息
      columns: [
        {key: 0, label: `项目名称`, visible: true},
        {key: 1, label: `合同类别`, visible: true},
        {key: 2, label: `装备名称`, visible: false},
        {key: 3, label: `装备型号`, visible: true},
        {key: 4, label: `数量`, visible: false},
        {key: 5, label: `技术状态`, visible: false},
        {key: 6, label: `合同编号`, visible: false},
        {key: 7, label: `合同类型`, visible: true},
        {key: 8, label: `监管JS代表室`, visible: false},
        {key: 9, label: `监管事项`, visible: false},
        {key: 10, label: `项目类别`, visible: false},
        {key: 11, label: `采购部门`, visible: false},
        {key: 12, label: `主管人员`, visible: false},
        {key: 13, label: `项目管理机构`, visible: false},
        {key: 14, label: `任务状态`, visible: false},
        {key: 15, label: `装备承制单位`, visible: false},
        {key: 16, label: `承制单位`, visible: false},
        {key: 17, label: `进度要求`, visible: false},
        {key: 18, label: `配套合同/协议号`, visible: false},
        {key: 19, label: `总体装备承制单位`, visible: false},
        {key: 20, label: `总体JS代表室`, visible: false},
        {key: 21, label: `任务确认时间`, visible: false},
        {key: 22, label: `完成时间`, visible: false},
        {key: 23, label: `支付时间`, visible: false},
        {key: 24, label: `备注`, visible: false},
        {key: 25, label: `流水号`, visible: true},
        {key: 26, label: `合同关联号`, visible: false},
        {key: 27, label: `合同关联状态`, visible: true},
        {key: 28, label: `交付时间`, visible: false},
        {key: 29, label: `发文字号`, visible: false},
        {key: 30, label: `计划名称`, visible: false},
        {key: 31, label: `M级`, visible: false},
        {key: 32, label: `发文日期`, visible: false},
        {key: 33, label: `正式任务/任务预告`, visible: false},
        {key: 34, label: `装备采购部门`, visible: false},
        {key: 35, label: `项目编号`, visible: false},
        {key: 36, label: `采购类别`, visible: false},
        {key: 37, label: `项目预估经费`, visible: false},
        {key: 38, label: `是否异地监管`, visible: false},
        {key: 39, label: `所属军代局`, visible: false},
        {key: 40, label: `所属军代局主管机关`, visible: false},
        {key: 41, label: `时间要求`, visible: false},
        {key: 42, label: `项目实际总金额`, visible: false},
      ],
      // 关联表单校验
      rules2: {
        agreementNo: [
          {required: true, message: "协议号不能为空", trigger: "blur"},
        ],
        characteristicNum: [
          {required: true, message: "合同名称不能为空", trigger: "blur"},
        ],
        money: [
          { required: true, message: '请输入金额', trigger: 'blur' },
          { pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, message: '请输入正确格式,可保留六位小数' },
        ],
        totalContractAmount: [
          { required: true, message: '请输入合同总金额', trigger: 'blur' },
          { pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, message: '请输入正确格式,可保留六位小数' },
        ],
      },
      // 表单校验
      rules: {  sequenceNumber: [
          { required: true, message: "流水号不能为空", trigger: "blur" },
        ],
        contractType: [
          { required: true, message: "合同类别不能为空", trigger: "blur" },
        ],
        equipVersion: [
          { required: true, message: "装备型号不能为空", trigger: "blur" },
        ],
        contractNo: [
          { required: true, message: "合同编号不能为空", trigger: "blur" },
        ],
        managementAgency: [
          { required: true, message: "项目管理机构不能为空", trigger: "blur" },
        ],
        equipmentContractor: [
          { required: true, message: "装备承制单位不能为空", trigger: "blur" },
        ],
        matchingContractNo: [
          { required: true, message: "配套合同/协议号不能为空", trigger: "blur" },
        ],
        contractorUnit: [
          { required: true, message: "承制单位不能为空", trigger: "blur" },
        ],
        representativeOffice: [
          { required: true, message: "监管JS代表室不能为空", trigger: "blur" },
        ],
        executiveStaff: [
          { required: true, message: "主管人员不能为空", trigger: "blur" },
        ],
/*        deptId: [
          { required: true, message: "监管JS代表室不能为空", trigger: "blur" },
        ],*/
        contractDeclare: [
          { required: true, message: "合同类型不能为空", trigger: "blur" },
        ],
        deliveryTime: [
          { required: true, message: "交付时间不能为空", trigger: "blur" },
        ],
        messageNumber: [
          { required: true, message: "发文字号不能为空", trigger: "blur" },
        ],
        messageDate: [
          { required: true, message: "发文日期不能为空", trigger: "blur" },
        ],
        projectFunds: [
          { required: true, message: '请输入项目预估经费', trigger: 'blur' },
          { pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, message: '请输入正确格式,可保留六位小数' },
        ],
        actualTotalAmount: [
          { required: true, message: '请输入项目实际总金额', trigger: 'blur' },
          { pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, message: '请输入正确格式,可保留六位小数' },
        ],
      }
    };
  },
  mounted() {
    watermark.load({ watermark_txt: "  "   });
  },
  created() {
    this.getUserlist();
    this.getList();
    this.getTreeselect();
    this.getProduct();
    this.getProduct1();
  },
  methods: {
    //下拉列表获取所有用户基本信息
    getUserlist() {
      userlist().then(response => {
        this.userList = response.rows;
      });
    },
    //queryString 为在框中输入的值
    //cb 回调函数，将处理好的数据推回
    querySearchAsync(queryString, cb) {
      //因为autocomplete只识别value字段,所以用replace(/需要用的字段/g,"value")，将需要用的字段全部替换成value
      //(/***/g 是全部替换，如果不用全部替换，可以参考https://www.w3school.com.cn/jsref/jsref_replace.asp)
      let baseInfoJson= JSON.parse(JSON.stringify(this.userList).replace(/nickName/g,"value"));
      let results = queryString ? baseInfoJson.filter(this.createStateFilter(queryString)) : baseInfoJson;
      clearTimeout(this.timeout);
      this.timeout = setTimeout(() => {
        cb(results);
      }, 0.5*1000);
    },
    //根据输入的字段进行筛选
    createStateFilter(queryString) {
      return (state) => {
        return (state.value.toString().toLowerCase().indexOf(queryString.toLowerCase()) === 0);
      };
    },
    //将其他数据自动补全，采用覆盖的方法
    handleSelect(item){
      this.form.executiveStaf = item.value;
    },

    inputFunds() {
      let price = this.form.projectFunds
      let pArr = price.split('.') //得到的是数组,pArr[0]为整数部分,pArr[1]为小数部分
      if(pArr.length > 1) {
        this.form.projectFunds = pArr[0] + "." + pArr[1].substr(0, 6);
      }
    },
    inputTotalAmount() {
      let price = this.form.actualTotalAmount
      let pArr = price.split('.') //得到的是数组,pArr[0]为整数部分,pArr[1]为小数部分
      if(pArr.length > 1) {
        this.form.actualTotalAmount = pArr[0] + "." + pArr[1].substr(0, 6);
      }
    },
    inputNum(){
      let price = this.form.money
      let pArr = price.split('.') //得到的是数组,pArr[0]为整数部分,pArr[1]为小数部分
      if(pArr.length > 1) {
        this.form.money = pArr[0] + "." + pArr[1].substr(0, 6);
      }
    },
    inputAmount(){
      let price = this.form.totalContractAmount
      let pArr = price.split('.') //得到的是数组,pArr[0]为整数部分,pArr[1]为小数部分
      if(pArr.length > 1) {
        this.form.totalContractAmount = pArr[0] + "." + pArr[1].substr(0, 6);
      }
    },
    //下拉列表获取所有产品信息
    getProduct() {
      listProduct().then(response => {
        let data = response.rows;
        for (let i = 0; i < data.length; i++) {
          if (data[i].differentiateStates == '0') {
            this.options.push({
              value: data[i].productType,
              label: data[i].productType,
            })
          }
        }
      });
    },
    //下拉列表获取所有零件信息
    getProduct1() {
      listProduct().then(response => {
        let data = response.rows;
        for (let i = 0; i < data.length; i++) {
          if (data[i].differentiateStates == '1') {
            this.partoptions.push({
              value: data[i].partType,
              label: data[i].partType,
            })
          }
        }
      });
    },
    indexMethod(index) {
      index = (index + 1) + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
      return index
    },
    /** 查询合同台账列表 */
    getList() {
      this.loading = true;
      listContract(this.queryParams).then(response => {
        this.contractList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 查询部门下拉树结构 */
    getTreeselect() {
      treeselect().then(response => {
        this.deptOptions = response.data;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 取消按钮
    viewCancel() {
      this.view.open = false;
      this.reset();
    },
    // 取消按钮
    releaCancel() {
      this.relea.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        sequenceNumber: null,
        contractAssociationNo: null,
        purchaseCard: null,
        projectName: null,
        contractType: "1",
        equipName: null,
        equipVersion: null,
        quantity: null,
        technicalConditions: null,
        contractNo: null,
        contractDeclare: null,
        representativeOffice: null,
        regulation: null,
        projectType: null,
        purchasingDepartment: null,
        managementAgency: null,
        taskConfirmationTime: null,
        executiveStaff: null,
        taskStatus: "0",
        completionTime: null,
        deliveryTime: null,
        messageNumber: null,
        planName: null,
        security: null,
        messageDate: null,
        formalTask: null,
        procurementDepartment: null,
        projectNo: null,
        purchaseCategory: null,
        projectFunds: null,
        manufacturer: null,
        remoteSupervision: null,
        representativeOfficeBelongs: null,
        competentAuthorityAgency: null,
        timeRequirements: null,
        actualTotalAmount: null,
        note: null,
        userId: null,
        deptId: null,
        equipmentContractor: null,
        paymentTime: null,
        contractAssociationStatus: "0",
        scheduleTarget: null,
        contractorUnit: null,
        supportingEquipment: null,
        matchingContractNo: null,
        generalRepresentativeOffice: null,
        generalContractorUnit: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.is=selection.map(item => item.sequenceNumber)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },

    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加监管任务";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getContract(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改监管任务";
      });
    },

    /** 关联按钮操作 */
    handleRelea(row) {
      this.reset();
      console.log(row)
      const id = row.id || this.ids
      getContract(id).then(response => {
        this.form = response.data;
        this.form.taskId=row.id;
        this.form.batchNum=row.contractAssociationNo;
        this.form.personLiable=row.executiveStaff;
      });
        this.relea.open = true;
        this.relea.title = "新增合同台账";
    },
    releasubmitForm(){
      this.$refs["form"].validate(valid => {
        if (valid) {
          //后台接收的数据是string类型，前台传值需要把数组类型的数据转换成string类型
          if(this.form.productType!= undefined){
            this.form.productType = this.form.productType.toString()
          }
          //后台接收的数据是string类型，前台传值需要把数组类型的数据转换成string类型
          if(this.form.partType!= undefined){
            this.form.partType = this.form.partType.toString()
          }
            addSecond(this.form).then(response => {
              this.$modal.msgSuccess("关联成功");
              this.relea.open = false;
              this.getList();
            });
        }
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateContract(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addContract(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    handleContractTask(row){
      const id = row.id;
      let sequenceNumber = row.sequenceNumber;
      this.$router.push({ path:"/hetong/contracttask_detail", query: {id,sequenceNumber}});
    },
    /** 详细按钮操作 */
    handleView(row) {
      /*const id = row.id || this.ids
      getContract(id).then(response => {
        this.form = response.data;
        this.view.open = true;
        this.view.title = "查看合同台账信息";
      });*/
      const id = row.id;
      this.$router.push({ path:"/hetong/contract_detail", query: {id}});
    },

    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      const i=row.sequenceNumber || this.is;
      this.$modal.confirm('是否确认删除流水号为"' + i + '"的数据项？').then(function() {
        return delContract(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('module/cjl/contract/export', {
        ...this.queryParams
      }, `contract_${new Date().getTime()}.xlsx`)
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "监管任务信息导入";
      this.upload.open = true;
    },
    /** 下载模板操作 */
    importTemplate() {
      this.download('module/cjl/contract/importTemplate', {
      }, `contract_template_${new Date().getTime()}.xlsx`)
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
      this.getList();
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    }
  }
};
</script>
<style>
  .el-header, .el-footer {
    background-color: #FFFFFF;
    color: #333;
    text-align: left;
    line-height: 60px;
    font-style: oblique;

  }

  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }
  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }

  /*对话框标题样式*/
  .el-dialog__title{
    /*color: #1ab394;*/
    font-weight: bold;
    font-size: 25px;
  }
</style>
